import UIKit
import PlaygroundSupport

let container = UIView()
container.bounds.size = CGSizeMake(300, 300)
container.backgroundColor = .init(white: 0.2, alpha: 1)
PlaygroundPage.current.liveView = container

//圆角label
let tagLabel = UILabel()
tagLabel.text = "减"
tagLabel.font = UIFont.systemFont(ofSize: 14)
tagLabel.textColor = .white

//iOS UILabel 简单高效添加圆角
//https://www.jianshu.com/p/1f8602edd1ac
tagLabel.layer.backgroundColor = UIColor.orange.cgColor
tagLabel.layer.cornerRadius = 2


container.addSubview(tagLabel)
tagLabel.sizeToFit()
tagLabel.center = container.center

print(container.frame,container.center)

let onTimeLb = UILabel()
container.addSubview(onTimeLb)

onTimeLb.text = "准时送"
onTimeLb.textColor = .systemMint
onTimeLb.sizeToFit()
onTimeLb.frame.origin = .init(x: 100, y: 100)

onTimeLb.layer.backgroundColor = UIColor.init(white: 0.4, alpha: 0.8).cgColor
onTimeLb.layer.cornerRadius = 2
